package com.bz.common;

import java.io.Serializable;

import lombok.Data;

@Data
public class ResponseDto<T> implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    /**
     * 返回码
     */
    private int               status;

    /**
     * 返回描述
     */
    private String            msg;

    /**
     * 返回数据
     */
    private T                 data;

    public ResponseDto() {
        this.status = Codeenum.SUCCESS.getCode();
        this.msg = Codeenum.SUCCESS.getMsg();
    }

    public ResponseDto(int status, String msg) {
        this.status = status;
        this.msg = msg;
    }

    public ResponseDto(int status, String msg, T data) {
        this.status = status;
        this.msg = msg;
        this.data = data;
    }

    public ResponseDto(Codeenum ce) {
        this.status = ce.getCode();
        this.msg = ce.getMsg();
    }

    public ResponseDto(T data) {
        this.status = Codeenum.SUCCESS.getCode();
        this.msg = Codeenum.SUCCESS.getMsg();
        this.data = data;
    }
}
